import { createRouter, createWebHistory } from 'vue-router';
import LoginPage from '@/views/LoginPage.vue';
import Home from '@/views/Home.vue';
import BookList from '@/components/BookList.vue';
import ProblemList from '@/components/ProblemList.vue';
import ProblemPage from "@/components/ProblemPage.vue";

const routes = [
  { path: '/login', component: LoginPage },
  {
    path: '/',
    component: Home,
    children: [
      { path: 'books', component: BookList },
      { path: 'problems', component: ProblemList },
      { path: 'problem/:id', component: ProblemPage }, // 编辑问题页面
      { path: 'problem', component: ProblemPage },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});


export default router;
